package fr.jfc.serveur;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.*;
import net.sf.hibernate.*;

import com.minosis.*;
import com.minosis.hibernate.HibernateUtil;





public class Requete<T>  {
	Session session;
	Transaction tx;
	
	public Requete() throws HibernateException
	{
		
			session = HibernateUtil.currentSession();
			tx = session.beginTransaction();
	}
	
	public void deconnexion() throws HibernateException
	{
		 HibernateUtil.closeSession();
		
	}
	
	public List<T> select(String requete) throws HibernateException
	{
		List list = session.find(requete);
		return list;
		
	}
	
	public void deleteRequete(String req) throws HibernateException
	{
		session.delete(req);
		tx.commit();
	}
	
	
	

}
